<div ng-controller="AddServerModalCtrl" class="clearfix details">
	<div class="row wrapper-md add-content">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading font-bold"><span>{{modalName}}</span>
					<button class="btn btn-default pull-right m-t-n-7" ng-click="goBack()"><i class="fa fa-reply"></i> 返回</button>
				</div>
				<div class="panel-body">
					<form class="form-horizontal form-validation user-form" name="addForm">
						<div class="search-box m-t-md" data-ng-include="'/statics/tpl/assets/infrastructure/basicInfo.html'"></div>
						<div class="search-box m-t-md">
							<div class="legend">配置信息</div>
							<div class="search-content">
								<div class="form-group">
									<div class="col-md-4 input-error-info">
										<label class="control-label"><span>*</span>数据中心：</label>
										<select class="form-control" name="centerId" ng-change="loadSelectData(0,itemData.dcId)" validator="required"
										        ng-model="itemData.dcId" ng-disabled="sourceDisabled">
											<option value="">--请选择--</option>
											<option ng-repeat="item in dataCenterData" ng-selected="item.id == itemData.dcId"
											        value="{{item.id}}" ng-bind="item.name"></option>
										</select>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label"><span>*</span>机房：</label>
										<select class="form-control" name="roomId" ng-change="loadSelectData(1,itemData.roomId)" validator="required"
										        ng-model="itemData.roomId" ng-disabled="sourceDisabled">
											<option value="">--请选择--</option>
											<option ng-repeat="item in roomData" ng-selected="item.id == itemData.roomId" value="{{item.id}}"
											        ng-bind="item.name"></option>
										</select>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label"><span>*</span>机柜：</label>
										<select class="form-control" name="rackId" validator="required" ng-model="itemData.rackId"
										        ng-disabled="sourceDisabled">
											<option value="">--请选择--</option>
											<option ng-repeat="item in cabinetData" ng-selected="item.id == itemData.rackId"
											        value="{{item.id}}" ng-bind="item.name"></option>
										</select>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-4 input-error-info">
										<label class="control-label"><span>*</span>机器名：</label>
										<input type="text" name="name" class="form-control" ng-model="itemData.name" validator="required,name" ng-disabled="isDetail"/>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label"><span>*</span>类别：</label>
										<select class="form-control" name="type" ng-model="itemData.type" ng-disabled="isDetail">
											<option ng-repeat="(key,item) in typeData" ng-selected="key==itemData.type" value="{{key}}" ng-bind="item"></option>
										</select>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label">操作系统：</label>
										<input type="text" name="osName" class="form-control" ng-model="itemData.osName" ng-disabled="isDetail"/>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-4 input-error-info">
										<label class="control-label">内存(M)：</label>
										<input type="text" name="memoryCapacity" class="form-control" ng-model="itemData.memoryCapacity"
										       placeholder="单位：M" validator="number_opt" ng-disabled="isDetail"/>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label">CPU频率(G)：</label>
										<input type="text" name="cpuHz" class="form-control" ng-model="itemData.cpuHz" placeholder="单位：G"
										       validator="number_opt" ng-disabled="isDetail"/>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label">CPU数量：</label>
										<input type="text" name="processorAmount" class="form-control" ng-model="itemData.processorAmount" validator="number_opt" ng-disabled="isDetail"/>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-4 input-error-info">
										<label class="control-label">MAC：</label>
										<input type="text" name="mac" class="form-control" ng-model="itemData.mac" ng-disabled="isDetail"/>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label"><span>*</span>管理IP：</label>
										<input type="text" name="managerIp" class="form-control" ng-model="itemData.managerIp" validator="required,ip" ng-disabled="isDetail"/>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label">管理端口：</label>
										<input type="text" name="managerPort" class="form-control" ng-model="itemData.managerPort" validator="port_opt" ng-disabled="isDetail"/>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-4 input-error-info">
										<label class="control-label"><span>*</span>管理账户：</label>
										<input type="text" name="osAccount" class="form-control" ng-model="itemData.osAccount" validator="required,account" ng-disabled="isDetail"/>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label"><span>*</span>管理密码：</label>
										<input class="form-control" name="osPassword" maxlength="18" validator="required,passwords"
										       ng-model="itemData.osPassword" type="{{showPass_os?'text':'password'}}"
										       ng-disabled="isDetail"/>
										<span class="eye" ng-class="{'eye-show':itemData.osPassword}"
										      ng-click="showPassword('showPass_os')"></span>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label">IPMI账号：</label>
										<input type="text" name="ipmiAccount" class="form-control" ng-model="itemData.ipmiAccount" validator="account_opt" ng-disabled="isDetail"/>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-4 input-error-info">
										<label class="control-label">IPMI密码：</label>
										<input class="form-control" name="ipmiPassword" maxlength="18" validator="password_opt" ng-model="itemData.ipmiPassword" type="{{showPass_ipmi?'text':'password'}}" ng-disabled="isDetail"/>
										<span class="eye" ng-class="{'eye-show':itemData.ipmiPassword}" ng-click="showPassword('showPass_ipmi')"></span>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label">IPMI地址：</label>
										<input type="text" name="ipmiAddress" class="form-control" ng-model="itemData.ipmiAddress" validator="ip_opt" ng-disabled="isDetail"/>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label">IPMI端口：</label>
										<input type="text" name="ipmiPort" class="form-control" ng-model="itemData.ipmiPort"
										       validator="port_opt" ng-disabled="isDetail"/>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-4 input-error-info">
										<label class="control-label">主密钥信息：</label>
										<input type="text" name="keyStore" class="form-control" ng-model="itemData.keyStore" ng-disabled="isDetail"/>
									</div>
									<div class="col-md-4 input-error-info">
										<label class="control-label">服务器类型：</label>
										<input type="text" name="category" class="form-control" ng-model="itemData.category" ng-disabled="isDetail"/>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-12 input-error-info">
										<label class="control-label m-t-n-70">备注：</label>
										<textarea class="form-control" name="remark" placeholder="备注" ng-model="itemData.remark"
										          maxlength="256" ng-disabled="isDetail"></textarea>
									</div>
								</div>
							</div>
						</div>
					<!--<div class="search-box m-t-md" ng-show="!isDetail" >-->
						<!--<div class="row" ng-spider-common="" spider-data="spiderData" spider="$parent.spider" ng-if="isDataShow"></div>-->
					<!--</div>-->
					</form>
					<div class="col-md-12 m-t-md m-b-sm btn-list" ng-hide="isDetail">
						<div class="col-md-6">
							<button type="submit" class="btn btn-info" validation-submit="addForm" ng-disabled="(addForm.$invalid||isLoadingActive)" ng-click="save()">确认
							</button>
						</div>
						<div class="col-md-6">
							<button class="btn btn-cancel" ng-click="goBack()">取消</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--<div class=" m-t-md" ng-if="isDetail">-->
			<!--<div class="legend">关系信息</div>-->
			<!--<div class="row" ng-simple-assets-graph="" node-data="nodeData" ng-if="isDataLoad"  style="width: 100%;height: 600px">-->

			<!--</div>-->
		<!--</div>-->
	</div>
</div>